#include<stdio.h>
int main()
{
	int days_until_year = 0;
	int year,month,day;
	int days_in_month[13]={0,31,28,31,30,31,30,31,31,30,31,30,31};
	scanf("%d-%d-%d",&year,&month,&day);
	if(((year%4==0)&&(year%100!=0))||(year%400==0))
		days_in_month[2]=29;
	for(int i = month+1;i<=12;i++)
	{
		days_until_year+=days_in_month[i];
	}
	days_until_year+=(days_in_month[month]-day+1);
	printf("还有%d天到新年",days_until_year);
	return 0;
}
//#include<stdio.h>
//int main()
//{
//	int year,month,day;
//	scanf("%d-%d-%d",&year,&month,&day);
//	int days_in_month[] = {0,31,28,31,30,31,30,31,31,30,31,30,31};
//	if((year %4 ==0&&year%100!=0)||(year%400==0))
//	{
//		days_in_month[2]= 29;
//	}
//	int days_until_new_year = 0;
//	int i = 0;
//	for(i = month+1;i<=12;i++)
//	{
//		days_until_new_year += days_in_month[i];
//	}
//	days_until_new_year += days_in_month[month]-day+1 ;
//	printf("还有%d天到新年\n",days_until_new_year);
//}
